<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>TZ-追梦</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;
        }
        body{
            background: black;
            /*perspective-origin: top center;*/
            perspective: 800px;
        }
        #heart3D{
            position: absolute;
            left:0;
            right: 0;
            top:0;
            bottom: 0;
            margin: auto;
            box-shadow: 0 0 2px white;
            width: 100px;
            height: 160px;
            transform-style: preserve-3d;
            animation: rot 10s ease-out infinite;
        }
        #heart3D div{
            position: absolute;
            width: 100px;
            height: 160px;
            border-width: 1px 1px 0 0;
            border-color: red;
            border-style: solid;
            border-radius: 40% 50%;
        }
/*        #heart3D div:nth-child(1){
            transform: rotateY(0deg) rotateZ(45deg) translateX(30px);
        }
        #heart3D div:nth-child(2){
            transform: rotateY(60deg) rotateZ(45deg) translateX(30px);
        }
        #heart3D div:nth-child(3){
            transform: rotateY(180deg) rotateZ(45deg) translateX(30px);
        }
        #heart3D div:nth-child(4){
            transform: rotateY(240deg) rotateZ(45deg) translateX(30px);
        }

*/
        @keyframes rot {
            100% {
                transform: rotateX(360deg)  rotateY(360deg);
            }
        }
    </style>
</head>
<body>
    <div id="heart3D">
<!--    <div></div>
        <div></div>
        <div></div>
        <div></div>
-->
    </div>

    <script>
        /*var str = '';
        for(var i=0;i<36;i++){
            str += '<div style="transform:rotateY('+i*10+'deg) rotateZ(45deg) translateX(30px)"></div>';
        }
        heart3D.innerHTML = str;*/

        for(var i=0;i<36;i++){
            var oDiv = document.createElement('div');
            oDiv['style']['transform'] = 'rotateY('+i*10+'deg) rotateZ(45deg) translateX(30px)';
            heart3D.appendChild(oDiv);
        }
    </script>
</body>
</html>